package org.vergil.core.service.mq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.vergil.core.mq.springMq.ProducerService;

import javax.jms.Destination;

/**
 * Created by vergil on 3/4/17.
 */
@Service
public class MqService {
    @Autowired
    private ProducerService producerService;

    @Autowired
    @Qualifier("queueDestination")
    private Destination destination;


    public void TestSend(){
        for (int i=0; i<5; i++) {
            producerService.sendMessage(destination, "你好，生产者！这是消息：" + (i+1));
        }
    }

    public void TestSendBack(){
        for (int i=0; i<5; i++) {
            producerService.sendMessage(destination, "你好，生产者！这是消息：" + (i+1));
        }
    }
}
